import zrender from 'zrender'
export default () => {
  console.log('start running...')
  console.log(zrender.version)
  var zr = zrender.init(document.getElementById('main'))
  var heart = new zrender.Heart({
    shape: {
      cx: 250,
      cy: 250,
      height: 50,
      width: 80
    },
    style: {
      fill: 'blue',
      stroke: '#F00',
      lineWidth: 4
    }
  })
  heart.animateTo({
    shape: {
      cx: 300,
      cy: 300
    },
    style: {
      fill: 'green'
    }
  }, 5000, 1000, 'linear', function () {
    console.log('animate is over')
  })
  zr.add(heart)
  document.querySelector('.btn').addEventListener('click', function () {
    heart.stopAnimation(true)
  })
}